﻿var enterpagetime = new Date();
var enterpagetimecon = enterpagetime.getFullYear()+"-"+(enterpagetime.getMonth()+1)+"-"+
    enterpagetime.getDate()+" "+enterpagetime.getHours()+":"+enterpagetime.getMinutes()+":"+enterpagetime.getSeconds();

function addLoadEvent(func){ 
	var oldonload=window.onload; 
		if(typeof window.onload!="function"){ 
			window.onload=func; 
		} 
		else{ 
			window.onload=function(){ 
			oldonload(); 
			func(); 
		} 
	}
}
var popTip = function() {
    var isover,timer;
    return function(text, hide, time, dom) {
        dom.innerHTML=text;
        dom.style.display="block";
        if(hide) {
            console.log(isover);
            if(isover) return;
            timer = setTimeout(function() {
                dom.style.display="none";
                isover=0;
            }, time);
            isover=1;
            console.log(isover);
        } else {
            return dom
        }
    }
}
var popTip=popTip();

addLoadEvent(function(){
	var w = document.body.clientWidth;
//	w=w>940?940:w;
	document.querySelector("html").style.fontSize = w/6.4+'px';
});
window.onresize = function(){
    var w = document.body.clientWidth;
    //w=w>940?940:w;
    document.querySelector("html").style.fontSize = w/6.4+'px';
};

(function () { 
    var licon = document.createElement("div")
    licon.setAttribute("id", "service");
    licon.innerHTML = '<a href="/V3_shop/message/message.html">\
    <div class="talk" >客服\
    </a></div>'; 
    console.log(document.querySelector("body"));
//    document.querySelector("body").appendChild(licon);

})();
var openid = sessionStorage.getItem("openid")||"o404p",
    ns = {};
    Nickname = sessionStorage.getItem("Nickname")||"n404k",
    ex = "noE",
    ntime = null,
    concent = "nocon",
    pgtitle = document.title;
    pgurl = "",
    code = "noncd",
    pmsizew = screen.width,
    pmsizeh = screen.height,
    comptpht = "GPU8858: ";
    document.addEventListener("click", getDomEvent);
function getDomEvent(event) {
    ex = event.target;
    pgurl = window.location.href;
    openid = sessionStorage.getItem("openid")||"o404p";
    Nickname = sessionStorage.getItem("Nickname")||"n404k";
    exdom = ex.outerHTML.slice(0,100);
    var ntm = new Date();
    comptpht = "GPU: " + MobileDevice.getGlRenderer() + " Device Models: " + MobileDevice.getModels().join(' or ');
    ntime = ntm.getFullYear()+"-"+(ntm.getMonth()+1)+"-"+ntm.getDate()+
            " "+ntm.getHours()+":"+ntm.getMinutes()+":"+ntm.getSeconds();
    concent = ex.dataset.vctxp||"nocon";
    code = ex.dataset.voltck||"noncd";

    ns = {"Openid":openid,"Nickname":Nickname,"Dom":exdom,"Eventtime":ntime,"Remark":concent,
        "Click_trajectory": code, "Pagetitle": pgtitle, "Pageurl": pgurl, "Screen_width": pmsizew, "Screen_height": pmsizeh,
    "Equipmentversion":comptpht,"Inputpagetime":enterpagetimecon};
}
(function () { var canvas, gl, glRenderer, models, devices = { "Apple A7 GPU": { 1136: ["iPhone 5", "iPhone 5s"], 2048: ["iPad Air", "iPad Mini 2", "iPad Mini 3"] }, "Apple A8 GPU": { 1136: ["iPod touch (6th generation)"], 1334: ["iPhone 6"], 2001: ["iPhone 6 Plus"], 2048: ["iPad Air 2", "iPad Mini 4"] }, "Apple A9 GPU": { 1136: ["iPhone SE"], 1334: ["iPhone 6s"], 2001: ["iPhone 6s Plus"], 2224: ["iPad Pro (9.7-inch)"], 2732: ["iPad Pro (12.9-inch)"] }, "Apple A10 GPU": { 1334: ["iPhone 7"], 2001: ["iPhone 7 Plus"]} }; function getCanvas() { if (canvas == null) { canvas = document.createElement("canvas") } return canvas } function getGl() { if (gl == null) { gl = getCanvas().getContext("experimental-webgl") } return gl } function getScreenWidth() { return Math.max(screen.width, screen.height) * (window.devicePixelRatio || 1) } function getGlRenderer() { if (glRenderer == null) { debugInfo = getGl().getExtension("WEBGL_debug_renderer_info"); glRenderer = debugInfo == null ? "unknown" : getGl().getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) } return glRenderer } function getModels() { if (models == null) { var device = devices[getGlRenderer()]; if (device == undefined) { models = [navigator.userAgent.match(/Andro.*?\)/) || navigator.userAgent] } else { models = device[getScreenWidth()]; if (models == undefined) { models = ["unknown" + getScreenWidth()] } } } return models } if (window.MobileDevice == undefined) { window.MobileDevice = {} } window.MobileDevice.getGlRenderer = getGlRenderer; window.MobileDevice.getModels = getModels })();

